From 4ad5e7790706924cd8a6bc5957a18d533f6808a5 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Thu, 31 Dec 2020 11:35:04 +0100 Subject: [PATCH] macos: do not crash in mojave The localizedName property is not available in Mojave so just ifdef in that case the code out. --- gdk/macos/gdkmacosmonitor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdk/macos/gdkmacosmonitor.c b/gdk/macos/gdkmacosmonitor.c index fdeadadcea..ad124a9e64 100644 --- a/gdk/macos/gdkmacosmonitor.c +++ b/gdk/macos/gdkmacosmonitor.c @@ -145,6 +145,7 @@ GetSubpixelLayout (CGDirectDisplayID screen_id) static char * GetLocalizedName (NSScreen *screen) { +#ifdef AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER GDK_BEGIN_MACOS_ALLOC_POOL; NSString *str; @@ -158,6 +159,9 @@ GetLocalizedName (NSScreen *screen) GDK_END_MACOS_ALLOC_POOL; return g_steal_pointer (&name); +#else + return NULL; +#endif } static char * -- 2.30.2